package com.organization.services

import java.sql.Timestamp
import java.util.regex.Pattern

/**
 * Created with IntelliJ IDEA.
 * User: inester
 * Date: 09.07.12
 * Time: 15:08
 * To change this template use File | Settings | File Templates.
 */
class CommonServiceTest extends GroovyTestCase {
    void testCommonServicesMethods(){
        CommonService testService = new CommonService()

        //test convertDateFromJson
        Timestamp ts = testService.convertDateFromJson("2012-06-27")
        assertEquals "2012-06-27 00:00:00.0", ts.toString()
    }

    //test regexp in groovy
    void testGroovyRegex(){
        String s = "treeCacheOrganization"
        Pattern p = Pattern.compile('^treeCache.*$')
        assertTrue "expression FALSE", s==~p
    }
}
